#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QMap>
#include <QSettings>

class QWebView;
class QLineEdit;
class QPrinter;
class QLabel;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected slots:
    void openFile();
    void showMenuBar(bool show);
    void showAddressBar(bool show);
    void showStatusBar(bool show);

    void changeLocation();

    void adjustLocation();
    void adjustTitle();
    void setProgress(int p);

    void print();
    void viewSource();
    void slotSourceDownloaded();
    void printPreview(QPrinter *printer);

    void loadUrl(const QUrl& url);
    void test();

private:
    QWebView *webview;
    QLineEdit *locationEdit = 0;
    QLabel* statusLabel;
    QMap<QString, int> flags;
    QSettings *config;

    void createWebView();
};


#endif // MAINWINDOW_H
